import React from "react";
import "./App.css";

class Footer extends React.Component {
    constructor(props) {
        super(props)
    }
    componentWillReceiveProps(p) {

    }
    render() {
        return (
            <div>
                    {/* <h2>留言板</h2> */}
                <textarea ref="div" rows="5" cols="30" className="text"></textarea>
                <br></br> <button onClick={() => {
                    var value = this.refs.div.value
                    this.props.message(value)
                }}>提交</button>
                <input type="file" onChange={(event) => {
                    var reader = new FileReader()
                    reader.onload = (event) => {
                        var img = event.target.result
                        this.props.image(img)
                    }
                    reader.readAsDataURL(event.target.files[0])

                }} />
            </div>
        )
    }
}
export default Footer